#include "game.h"
#include <conio.h>
#include <time.h>
#include <windows.h>
#include <stdio.h>
#include <fstream>
#include <string.h>
//#include "vectr.h"

using namespace std;

int main()
{

	Game g("map.txt");

	bool running = true;
	time_t now, then = clock();
	while(running)
	{
		if(kbhit())
		{
			g.handleInput(getch());
		}
		else
		{
			now = clock();
			g.draw();
			g.update((int)(now - then));
			then = now;
			while(!kbhit() && clock() < now+50){Sleep(1);}
		}
	}
	return 0;
}